//
//  CustomQQCollectionViewCell.m
//  23-QQ音乐
//
//  Created by dllo on 16/8/15.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "CustomQQCollectionViewCell.h"
#import "MVConllectionList.h"
#import "UIImageView+WebCache.h"
@interface CustomQQCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iamgeViewPic;
@property (weak, nonatomic) IBOutlet UILabel *songName;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
@end

@implementation CustomQQCollectionViewCell
- (void)setMvCollectionList:(MVConllectionList *)mvCollectionList {
    _mvCollectionList = mvCollectionList;
    NSString *songAndSinger = [mvCollectionList.mvtitle stringByAppendingFormat:@"- %@", mvCollectionList.singername];
    _songName.text = songAndSinger;
    _descLabel.text = mvCollectionList.mvdesc;
    if (mvCollectionList.picurl.length != 0) {
        [_iamgeViewPic sd_setImageWithURL:[NSURL URLWithString:mvCollectionList.picurl] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
            
        }];
    } else {
        NSString *imageUrl = [NSString stringWithFormat:@"http://shp.qpic.cn/qqvideo_ori/0/%@_360_204/0?max_age=259200", mvCollectionList.vid];
        [_iamgeViewPic sd_setImageWithURL:[NSURL URLWithString:imageUrl] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
            
        }];
    }
    
    
}

@end
